package com.oriental.manage.controller.opcif;

import com.oriental.manage.core.enums.CacheKey;
import com.oriental.manage.core.system.Constants;
import lombok.Data;
import lombok.ToString;
import org.apache.commons.lang.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * Desc:
 * Date: 2017/5/10
 * User: Chuch
 * See :
 */
@Data
@ToString
public class CountMap {

    public static String queryFailType(String failReason) {
        if (failReason == null || failReason.trim().equals("")) {
            return "系统";
        }
        Map<String,String> map =  Constants.getDataDictMap().get(CacheKey.COUNT_FAIL_TYPE.name().toLowerCase());
        if(map==null){
            return "未知";
        }
        String val = map.get(failReason.trim());
        if (val == null) {
            return "未知";
        }
        return val;
    }

    public static String getBankName(String bankCode) {

        if (StringUtils.isBlank(bankCode)) {
            return "";
        }
        Map<String,String> map =  Constants.getDataDictMap().get(CacheKey.T_BANK_CODE.name().toLowerCase());
        if(map==null){
            return bankCode;
        }
        String val = map.get(bankCode.trim());
        if (val == null) {
            return bankCode;
        }
        return val;
    }


}
